{__NOLAYOUT__}
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/blue/skin.css" id="blue" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/common.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="/static/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="/static/lib/Validform/5.3.2/Validform.min.js"></script>
    <script type="text/javascript" src="/static/h-ui.admin/common.js"></script>
    <script type="text/javascript" src="/static/lib/laydate5.0.9/laydate.js"></script>
    <title>属性控制栏</title>
</head>
<body>
<div class="page-container">
    <input type="hidden" id="callbackId" value="{$Request.param.id}">
    <div>
        <div id="drag" style='width:80px;margin-left:30px'>
            <label for="file-input">
                <i class="Hui-iconfont Hui-iconfont-upload" style="font-size: 50px;color:blue" id="upload-btn"></i>
            </label>
        </div>
        <input type="file" accept="*/*" name="file[]" id="file-input" multiple class="input-file" style="display: none">
    </div>
</div>

<script src="/static/lib/H5upload.js"></script>

<script>
  $(function () {
    var callbackId = $("#callbackId").val();
    // 文件上传
    $("#file-input").tpUpload({
      url: '{:url("wfupsave")}',
      data: {a: 'a'},
      drag: '',
      start: function () {
        layer_msg = layer.msg('正在上传中…', {time: 100000000});
      },
      progress: function (loaded, total, file) {
        $('.layui-layer-msg .layui-layer-content').html('已上传' + (loaded / total * 100).toFixed(2) + '%');
      },
      success: function (ret) {
        callback(callbackId,ret.msg[0],ret.data);
      },
      error: function (ret) {
        layer.alert(ret);
      },
      end: function () {
        layer.close(layer_msg);
      }
    });

  });

  /**
   * 数据回调
   * @param id
   * @param value
   */
  function callback(id,value,name) {
    if (window.parent.frames.length == 0){
      layer.alert('请在弹层中打开此页');
    } else {
      parent.document.getElementById(id).value = value;
      parent.$("#s"+id).remove();
      var data = '<br/><b id="s'+id+'">'+name+'</b>';
      parent.$('#b'+id).after(data);
      parent.$('#b'+id).html('上传成功！');
      parent.$('#b'+id).removeAttr('onclick');
      layer_close();
    }
  }

</script>